package cn.jhc.servlet;

import java.io.IOException;

import javax.servlet.RequestDispatcher;
import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import cn.jhc.dao.ConnectionFactory;
import cn.jhc.dao.ShowmvDAO;

@WebServlet(name = "update Star Yes", urlPatterns = { "/houtai_StarYes.do" })
public class Houtai_StarYesServlet extends HttpServlet {
	@Override
	protected void doGet(HttpServletRequest req, HttpServletResponse resp)
			throws ServletException, IOException {
		req.setCharacterEncoding("UTF-8");
		String Id = (String) req.getParameter("id");
		int id = Integer.parseInt(Id);
		ShowmvDAO dao = new ShowmvDAO();
		dao.setCon(ConnectionFactory.getConnection());
		dao.UpdateStarYes(id);
		RequestDispatcher dispatcher = req.getRequestDispatcher("/houtai_monthstar.jsp");
		dispatcher.forward(req, resp);
	}
	protected void doPost(HttpServletRequest req, HttpServletResponse resp)
			throws ServletException, IOException {
		doGet(req, resp);
	}
}
